package Stringdemo;

public class demo3 {
    public static void main(String[] args) {
        String string = new String("Harry Porter great magic");
        String[] sp1 = string.split(" ");
        for(String st:sp1)
        {
            System.out.println(st);
        }
        String[] sp2 = string.split(" ",2);
        for(String st:sp2)
        {
            System.out.println(st);
        }
    }
}
